package com.bw.module_service.adapter

import android.graphics.Color
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.bw.module_service.R
import com.bw.module_service.fragment.AbsenceFragment
import com.bw.module_service.fragment.AllFragment
import com.bw.module_service.fragment.LateFragment
import com.bw.module_service.fragment.LeaveEarlyFragment
import com.bw.module_service.fragment.NormalFragment
import com.bw.module_service.model.SignStatusTab

class FragmentAdapter(
    fragmentActivity: FragmentActivity,
    private val itemCount: Int,
    ) :
    FragmentStateAdapter(fragmentActivity) {



    override fun getItemCount(): Int = itemCount

    override fun createFragment(position: Int): Fragment {
        // 根据位置返回不同的Fragment实例
        return when (position) {
            0 -> AllFragment()
            1 -> NormalFragment()
            2 -> LateFragment()
            3 -> LeaveEarlyFragment()
            4 -> AbsenceFragment()
            else -> AllFragment()
        }




    }
}